<?php
		//Includes
		require('includes/db/DB_Mecanico.inc.php');
		include_once('includes/tools/html_table.class.php');
	
		$name		= $_GET["name"];
		$adr		= $_GET["adr"];
		$state		= $_GET["state"];
		$country	= $_GET["country"];
		
		//Static call to bAMecanico
		$mecList = DB_Mecanico::bAMecanico($name,$adr,$state,$country);

		//USING HTML_TABLE.CLASS
		//Create table instance
		if (count($mecList) > 0)
		{
			$tbl 		= new HTML_Table('bA_Table', 'table table-striped table-hover');
			$i 			= 1;
			$nameLink 	= '';
			foreach ($mecList as $mec)
			{
				$nameLink = '<a href="mecanico.php?vl='.$mec[0].'">'.$mec[1].'</a>';
				$tbl->addRow();
				$tbl->addCell($i);
				$tbl->addCell($nameLink);
				$tbl->addCell($mec[2]);
				$tbl->addCell($mec[3]);
				$i += 1;
			}
			echo $tbl->display();
		}
		else
		{
			echo "";
		}
?>
